<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for components\table\dx-table-body.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../prettify.css" />
    <link rel="stylesheet" href="../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../index.html">all files</a> / <a href="index.html">components/table/</a> dx-table-body.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/20</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/8</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/5</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/20</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
 	&lt;table 
 		ref="table" 
 		:class="{'is-vertical': borderColumn,'is-horizontal': borderRow}" 
 		class="dx-table-body"
 	&gt;
	 	&lt;colgroup&gt;
	 	  	&lt;col 
	 	  		v-for="column in columns" 
	 	  		:key="column.id" 
	 	  		:width="column.width" 
	 	  		:name="column.id"
	 	  	/&gt;
	 	&lt;/colgroup&gt;
	 	&lt;thead 
	 		:class="[tableHeadClass]"
	 		class="dx-table-body__table-head" 
	 	&gt; 
	 	     &lt;!-- 表格标题 --&gt;
	 	   	&lt;tr&gt;
	 	   		&lt;th 
	 	   			v-for="column in columns" 
	 	   			:key="column.id" 
	 	   			@click="toggleSortData(column)"
	 	   		&gt;
	 	   			&lt;span v-if="!column.isExpand &amp;&amp; column.selectable"&gt;
	 	      	    	&lt;input 
	 	      	    		ref="selectedAll"
	 	      	    		class="dx-table-body--checkbox" 
	 	      	    		type="checkbox" 
	 	      	    		@click="toggleSelectAllRows($event.target.checked)"
	 	      	    	&gt;
	 	      	    &lt;/span&gt;
	 	      	    &lt;span v-else-if="!column.isExpand"&gt;
	 	      	    	{{column.renderHeader(column.label)}}
		 	   			&lt;span 
		 	   				v-if="column.sortable" 
		 	   				class="dx-table-body__table-head--sort-index"
		 	   			&gt;
			 	   			&lt;i 
			 	   				:class="{'is-sort-active':column.reverse !== 'descending'}" 
			 	   				class="icon iconfont dx-up dx-table-body__table-head--icon-up" 
			 	   				aria-hidden="true"
			 	   			&gt;
			 	   			&lt;/i&gt;
			 	   			&lt;i :class="{'is-sort-active':column.reverse === 'descending'}" 
			 	   				class="icon iconfont dx-down dx-table-body__table-head--icon-down" 
			 	   				aria-hidden="true"
			 	   			&gt;
			 	   			&lt;/i&gt;
		 	   			&lt;/span&gt;
	 	   			&lt;/span&gt;
	 	   		&lt;/th&gt;
	 	   	&lt;/tr&gt;
	 	&lt;/thead&gt;
	 	&lt;tbody 
	 		:class="[tableBodyClass]" 
	 		class="dx-table-body__table-body"
	 	&gt;
	 	  	&lt;!-- 表格内容 --&gt;
	 	    &lt;tr v-for="(row,index) in data" 
	 	    	:key="index"
	 	    &gt;
	 	      	&lt;td v-for="column in columns" 
	 	      		:key="column.id"
	 	      	&gt;
	 	      	    &lt;span 
	 	      	    	v-if="column.selectable" 
	 	      	    	key="select"
	 	      	    &gt;
	 	      	    	&lt;input  
	 	      	    		class="dx-table-body--checkbox" 
	 	      	    		type="checkbox" 
	 	      	    		@click="toggleSelectRow(index)"
	 	      	    	&gt;
	 	      	    &lt;/span&gt;
	 	      	    &lt;span 
	 	      	    	v-else-if="column.label === '操作' &amp;&amp; (handleEdit || handleDelete)"
	 	      	    	key="handle"
	 	      	    &gt;
	 	      	    	&lt;dx-button 
	 	      	    		v-if="handleEdit"
	 	      	    		type="primary" 
	 	      	    		icon="pencil" 
	 	      	    		size="small"
	 	      	    		@dx-button-click="handleEdit(index, row)"
	 	      	    	&gt;
	 	      	    		编辑
	 	      	    	&lt;/dx-button&gt;
	 	      	    	&lt;dx-button 
	 	      	    		v-if="handleDelete"  
	 	      	    		type="warning" 
	 	      	    		icon="trash" 
	 	      	    		size="small"
	 	      	    		@dx-button-click="handleDelete(index, row)"
	 	      	    	&gt;
	 	      	    		删除
	 	      	    	&lt;/dx-button&gt;
	 	      	    &lt;/span&gt;
	 	      	   	&lt;dx-table-cell 
	 	      	   		v-else 
	 	      	   		:index="index"
	 	      	   		:column="column" 
	 	      	   		:row="row" 
	 	      	   	/&gt;
	 	      	&lt;/td&gt;	
	 	    &lt;/tr&gt;
	 	&lt;/tbody&gt;
 	&lt;/table&gt;
&lt;/template&gt; 
&lt;script&gt;
import DxTableCell from './dx-table-cell.js'
// table-body组件
export default {
	components: {
		DxTableCell
	},
	props: {
&nbsp;
		store: {
			required: true
		},
		borderColumn: {
			type: Boolean,
			default: false
		},
		borderRow: {
			type: Boolean,
			default: false
		},
		tableHeadClass: String,
		tableBodyClass: String,
		handleEdit: Function,
		handleDelete: Function
	},
	computed: {
		// 找到父table组件
		parent() {
<span class="cstat-no" title="statement not covered" >			return this.$parent</span>
		},
		states() {
<span class="cstat-no" title="statement not covered" >			return this.store.states</span>
		},
		columns() {
<span class="cstat-no" title="statement not covered" >			return this.states.columns</span>
		},
		data() {
<span class="cstat-no" title="statement not covered" >			return this.states.data</span>
		},
		selectHead() {
			// 需要判断是否存在选择列，通过表格标题栏来判断
<span class="cstat-no" title="statement not covered" >			return this.$refs.selectedAll &amp;&amp; this.$refs.selectedAll[0]</span>
		},
		table() {
<span class="cstat-no" title="statement not covered" >			return this.$refs.table</span>
		}
	},
	created() {
		const self = <span class="cstat-no" title="statement not covered" >this</span>
<span class="cstat-no" title="statement not covered" >		this.parent.$on('clear-all-select', function() <span class="fstat-no" title="function not covered" >{</span></span>
			// 在清除按钮点击事件时，需要判断是否存在按钮
<span class="cstat-no" title="statement not covered" >			if (self.selectHead) {</span>
<span class="cstat-no" title="statement not covered" >				self.selectHead.checked = false</span>
<span class="cstat-no" title="statement not covered" >				self.toggleSelectAllRows(false)</span>
			}
		})
	},
	methods: {
		// 切换排序
		toggleSortData: function(column) <span class="fstat-no" title="function not covered" >{</span>
<span class="cstat-no" title="statement not covered" >			if (column.sortable) {</span>
<span class="cstat-no" title="statement not covered" >				this.store.commit('sortData', column)</span>
<span class="cstat-no" title="statement not covered" >				column.reverse = column.reverse === 'descending' ? 'increaing' : 'descending'</span>
			}
		},
		// 选择单行数据
		toggleSelectRow: function(index) <span class="fstat-no" title="function not covered" >{</span>
			// this.$refs.selectedAll为什么是数组？
<span class="cstat-no" title="statement not covered" >			this.selectHead.checked = false</span>
<span class="cstat-no" title="statement not covered" >			this.store.commit('toggleSelectData', index)</span>
		},
		// 点击头部的全部选中
		toggleSelectAllRows: function(isCheckedAll) <span class="fstat-no" title="function not covered" >{</span>
			// 优化一下
			let inputs = <span class="cstat-no" title="statement not covered" >this.table.querySelectorAll(".dx-table-body input[type='checkbox']")</span>
<span class="cstat-no" title="statement not covered" >			Array.prototype.map.call(inputs, function(value) <span class="fstat-no" title="function not covered" >{</span></span>
<span class="cstat-no" title="statement not covered" >				value.checked = isCheckedAll</span>
			})
<span class="cstat-no" title="statement not covered" >			this.store.commit('toggleSelectAllDatas', isCheckedAll)</span>
		}
	}
}
&lt;/script&gt;
&lt;style lang="scss"&gt;
	@include B(table-body) {
		/*border-spacing: 30px;*/
		/*合并表格边框*/
		width: 100%;
		border-collapse: collapse;
		font-size:$--dx-table-body-font-size;
		color: $--dx-table-body-color;
		cursor: default;
		/*border:0.1rem solid #aaa;*/
		/*table-layout: fixed;*/
		/*表格默认表格单元样式*/
		th, td {
			text-align: left;
			padding: 1rem;
			padding-left: 2rem;
		}
&nbsp;
		/*表格行，鼠标滑过样式*/
		tbody tr:hover {
			background-color: $--dx-table-body-tr-backgrounde-color-hover;
		}
		/*是否显示竖直边框*/
		@inlcude when(vertical) {
			border: 0;
			border-left: 0.1rem solid #ddd;
			th, td {
				border-right: 0.1rem solid #ddd;
			}
		}
&nbsp;
		/*表格是否显示行边框*/
		@inlcude when(horizontal) {
			border: 0;
			border-top: 0.1rem solid #ddd;
			th, td {
				border-bottom: 0.1rem solid #ddd;
			}
		}
		/* 显示行、列边框 */
		@include when(vertical) {
			@include when(horizontal) {
				border-top: 0.1rem solid #ddd;
				border-left: 0.1rem solid #ddd;
				th, td {
					border: 0.1rem solid #ddd;
				}
			}
		}
&nbsp;
		@include E(table-head) {
			/*表格排序指示器*/
			@include M(sort-index) {
				position: relative;
				margin-left: 0.3rem;
		    }
&nbsp;
		    @include M(icon-up icon-down) {
				position: absolute;
				color: #aaa;
				 @include when(sort-active) {
					color: $--dx-table-body-color-sort-active;
				}
		    }
&nbsp;
		    @include M(icon-up) {
				top: -0.2rem;
		    }
&nbsp;
		    @include M(icon-down) {
				bottom: -0.2rem;
		    }
		}
		
		/*如果设置可以选择，checkbox按钮样式*/
		@include M(checkbox) {
			display: inline-block;
			width: $--dx-table-body-checkbox-height;
			height: $--dx-table-body-checkbox-height;
			background: $--dx-table-body-checkbox-background-color;
			color: $--dx-table-body-checkbox-color;
		}
	}
&lt;/style&gt;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 24 2019 15:08:50 GMT+0800 (中国标准时间)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>
